<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>

    //去除前后空格，trim();
//    var str1 = "   a   b   c   ";
//    console.log(str1);
//    console.log(str1.trim());


    //replace()替换
//    var str2 = "Today is fine day,today is fine day a!!!"
//    console.log(str2);
//    console.log(str2.replace(/today/gi,"tomorrow"));


    //字符串变数组split();  无参，是把字符串作为一个元素添加进数组中。空字符串，分隔字符串中每一个字符，分别添加进入数组中
            //指定字符分隔数组：特殊符号将不会出现在数组的任意一个元素中

    var str3 = "关羽|张飞|刘备";

    console.log(str3);
    console.log(str3.split("|"));

</script>
</body>
</html>